using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace Win32SDK
{
    public sealed class ComCtl32
    {
        public const string Dll = "comctl32.dll";
        private ComCtl32()
        {
        }


        [DllImport(ComCtl32.Dll)]
        public static extern bool ImageList_DrawEx(IntPtr himl, int i, IntPtr hdcDst, int x, int y, int dx, int dy, int rgbBk, int rgbFg, ILD fStyle);
        [DllImport(ComCtl32.Dll)]
        public static extern bool ImageList_Draw(IntPtr himl, int i, IntPtr hdcDst, int x, int y, ILD fStyle);
        [DllImport(ComCtl32.Dll)]
        public static extern IntPtr ImageList_GetIcon(IntPtr himl, int i, ILD flags);
        /// <summary>
        /// Begins dragging an image.
        /// </summary>
        /// <param name="himlTrack">Handle to the image list.</param>
        /// <param name="iTrack">Index of the image to drag.</param>
        /// <param name="dxHotspot">x-coordinate of the location of the drag position relative to the upper-left corner of the image.</param>
        /// <param name="dyHotspot">y-coordinate of the location of the drag position relative to the upper-left corner of the image.</param>
        /// <returns>Returns nonzero if successful, or zero otherwise.</returns>
        [DllImport(ComCtl32.Dll, CharSet = CharSet.Auto)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool ImageList_BeginDrag(IntPtr himlTrack, int iTrack, int dxHotspot, int dyHotspot);


        /// <summary>
        /// Displays the drag image at the specified position within the window.
        /// </summary>
        /// <param name="hwndLock">Handle to the window that owns the drag image.</param>
        /// <param name="x">X-coordinate at which to display the drag image.
        /// The coordinate is relative to the upper-left corner of the window, not the client area.</param>
        /// <param name="y">Y-coordinate at which to display the drag image.
        /// The coordinate is relative to the upper-left corner of the window, not the client area.</param>
        /// <returns>Returns nonzero if successful, or zero otherwise.</returns>
        [DllImport(ComCtl32.Dll, CharSet = CharSet.Auto)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool ImageList_DragEnter(IntPtr hwndLock, int x, int y);






        /// <summary>
        /// Unlocks the specified window and hides the drag image, allowing the window to be updated.
        /// </summary>
        /// <param name="hwndLock">Handle to the window that owns the drag image.</param>
        /// <returns>Returns nonzero if successful, or zero otherwise.</returns>
        [DllImport(ComCtl32.Dll, CharSet = CharSet.Auto)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool ImageList_DragLeave(IntPtr hwndLock);


        /// <summary>
        /// Moves the image that is being dragged during a drag-and-drop operation.
        /// This function is typically called in response to a WM_MOUSEMOVE message.
        /// </summary>
        /// <param name="x">X-coordinate at which to display the drag image.
        /// The coordinate is relative to the upper-left corner of the window, not the client area.</param>
        /// <param name="y">Y-coordinate at which to display the drag image.
        /// The coordinate is relative to the upper-left corner of the window, not the client area.</param>
        /// <returns>Returns nonzero if successful, or zero otherwise.</returns>
        [DllImport(ComCtl32.Dll, CharSet = CharSet.Auto)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool ImageList_DragMove(int x, int y);



        /// <summary>
        /// Shows or hides the image being dragged.
        /// </summary>
        /// <param name="fShow">Value specifying whether to show or hide the image being dragged.
        /// Specify <see langword="true"/> to show the image or <see langword="false"/> to hide the image.</param>
        /// <returns>Returns nonzero if successful, or zero otherwise. </returns>
        [DllImport(ComCtl32.Dll, CharSet = CharSet.Auto)]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool ImageList_DragShowNolock([MarshalAs(UnmanagedType.Bool)] bool fShow);

        /// <summary>
        /// Ends a drag operation.
        /// </summary>
        [DllImport(ComCtl32.Dll, CharSet = CharSet.Auto)]
        public static extern void ImageList_EndDrag();

















    }
    [Flags]
    public enum ILD
    {
        Normal = 0x0000,
        Transparent = 0x0001,
        Mask = 0x0010,
        Image = 0x0020,
        ROP = 0x0040,
        Belnd25 = 0x0002,
        Blend50 = 0x0004,
        OverlayMask = 0x0F00,
    }
}
